home *** CD-ROM | disk | FTP | other *** search
- /*
- ** UTurboTCP.h
- **
- ** TurboTCP support library
- ** Utility functions
- **
- ** Copyright © 1993-94, FrostByte Design / Eric Scouten
- */
-
-
- #pragma once
-
-
- // miscellaneous public constants
-
- #define minReceiveSize 4096L // minimum TCP receive buffer
- #define recReceiveSize 16384L // recommended TCP buffer size
- #define recAutoRecNum 4 // recommended # of auto-receive calls (set higher for high performance)
- #define recAutoRecSize 4 // recommended size of RDS for auto-receive (set higher for high performance)
-
-
- // custom OSErr codes: start from +23000 since MacTCP starts with -23000
-
- enum {
- noTCPError = 23000, // MacTCP is not installed
- noResolverErr = 23002, // MacTCP’s DNR is not available
- resolverInUse = 23003, // resolver call object was already being used
- resolverBusy = 23004 // MacTCP’s DNR was busy
- };
-
-
- /*______________________________________________________________________
- **
- ** UTurboTCP
- **
- ** Utility class. Created to reduce namespace pollution.
- **
- */
-
- class UTurboTCP {
-
- public:
-
- // opening/closing TCP services
-
- static void InitTCP();
- static void CloseTCP();
-
-
- // processing network events
-
- static void ProcessNetEvents(short maxEventsToProcess, long maxTicks);
-
-
- // IP address utilities
-
- static unsigned long GetLocalIPAddr();
- static void DoAddrToStr(unsigned long theIPaddr, char* theString);
-
- };
-